package com.ogilvy.audi.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.ogilvy.audi.bean.Acmnt;
import com.ogilvy.audi.dao.AcmntDao;
import com.ogilvy.frame.hibernate.BaseDaoImpl;
@Repository
public class AcmntDaoImpl  extends BaseDaoImpl<Acmnt> implements AcmntDao{
	public List<Acmnt> selectAll(int pageNo, int pageSize,Map<String,Object> condition){
		StringBuffer hql = new StringBuffer("select a from Acmnt a join a.album b where 1=1");
		if(condition.get("albumId")!=null){
			hql.append(" and b.albumId =").append(condition.get("albumId"));
		}
		return getSession().createQuery(hql.toString()).list();
	}
	public List<Acmnt> selectAll(Map<String,Object> condition){
		return null;
	}

}
